import axios from 'axios'
import storage from 'store'
const token = storage.get('token')

export const importFile = (url, data) => {
    return new Promise(async (resolve, reject) => {
        const response = await axios({
            url: process.env.VUE_APP_API_BASE_URL + url,
            method: 'POST',
            headers: {
                'Authorization': `Bearer ${token}`,
                'Content-Type': 'multipart/form-data'
            },
            data: data
        });
        if (response.data) {
            resolve(response)
        } else {
            reject(false)
        }
    })
} 